<html lang="en" dir="ltr">
<body>
<div id="maindiv" style="padding-top:50px">Hello World!</div>
</body>
<script>
function recordingFinished() {
  setTimeout(() => dump(`RecReplaySendAsyncMessage Example__Finished`), 0);
  window.foo.bar = 0;
}
var number = 0;
function f() {
  number++;
  document.getElementById("maindiv").innerHTML = "Number: " + number;
  if (number >= 10) {
    window.setTimeout(recordingFinished);
    return;
  }
  window.setTimeout(f, 1);
  throw new Error("Number " + number);
}
window.setTimeout(f, 1);

// Make sure things work with Error subclasses.
class MyError extends Error {}
class MyError2 extends Error {
  constructor(name) {
    super(name);
  }
}
window.setTimeout(() => {
  throw new MyError();
});
window.setTimeout(() => {
  throw new MyError2();
});

class Superclass {
  constructor() {
    this.x = 0;
    console.log("superclass");
  }
}
class Subclass extends Superclass {}
window.setTimeout(() => {
  new Subclass();
});
</script>
</html>
